class Solution {
    public int numWays(int n) {
        int a = 1, b = 2, num;
        for (int i = 0; i < n - 1; i++) {
            num = (a + b) % 1000000007;
            a = b;
            b = num;
        }
        return a;
    }
}